Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix renaming and saving of HtmlTableSheets from HtmlTablesSheets #1343

Merged
merged 2 commits into from
Apr 6, 2022

Conversation

anjakefala
Copy link
Collaborator

Closes #1339

@anjakefala anjakefala requested a review from saulpw April 3, 2022 03:05
@@ -91,7 +91,7 @@ def options(self):

def __init__(self, *names, **kwargs):
self._name = None # initial cache value necessary for self.options
self.names = names
self.names = list(names)
Copy link
Contributor

@frosencrantz frosencrantz Apr 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at this report and found the same bugs. I do not know the code very well, and was wondering does the getter/setter from visidata/sheets line 949 work? Will changing the name from the Index sheet change the name of the file that is saved? It updates names[] but it doesn't update name. I don't know how the two fields names and name are supposed to interact. It seems like one is calculated from the other looking at this line and the next.

Column('name', getter=lambda c,r: r.names[-1], setter=lambda c,r,v: setitem(r.names, -1, v)),

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are absolutely right! It changes the sheet name through the SheetsSheet, but not for html tables, at least.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I think I got a much better fix now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad I could help! Yes, I like this fix better, and I learned something.

Only saving selectedRows, so the sheet names should be pulled from
there.

Not all IndexSheets carry their sub-sheets in their `source`.

Closes #1339
@anjakefala anjakefala merged commit 759db7b into develop Apr 6, 2022
@anjakefala anjakefala deleted the kef/1339 branch April 6, 2022 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants